package com.ccys.cms.controller.masterData;

import com.ccys.cms.service.masterData.SpecialisationService;
import com.ccys.cms.service.masterData.SpecialisationService;
import com.ccys.common.constants.TouristApi;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.masterData.SpecialisationDelDto;
import com.ccys.db.dto.masterData.SpecialisationPageQueryDto;
import com.ccys.db.dto.masterData.SpecialisationSaveDto;
import com.ccys.db.entity.TblSpecialisation;
import com.ccys.db.vo.masterData.SpecialisationListVo;
import com.ccys.db.vo.masterData.SpecialisationPageQueryVo;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 * @program: WhiteCoat
 * @description: 专科管理接口
 * @author: ZhangJingCan
 * @create: 2023-12-13 10:22
 **/

@RestController
@RequestMapping("masterData")
@Api(tags = "masterData-专科管理接口")
public class SpecialisationController {

    @Autowired
    private SpecialisationService specialisationService;


    
    @PostMapping("specialisation")
    @ApiOperation("保存专科管理")
    public ResponseResult saveSpecialisation(SpecialisationSaveDto dto) {
        return specialisationService.saveSpecialisation(dto);
    }

    @PutMapping("specialisation")
    @ApiOperation("修改专科管理")
    public ResponseResult edit(SpecialisationSaveDto dto) {
        return specialisationService.saveSpecialisation(dto);
    }

    
    @DeleteMapping("specialisation")
    @ApiOperation("根据ID删除专科管理")
    public ResponseResult deleteSpecialisation(SpecialisationDelDto dto) {
        return specialisationService.deleteSpecialisation(dto);
    }

    
    @GetMapping("specialisation/page")
    @ApiOperation("分页查询专科管理")
    public ResponseResult<PageInfo<SpecialisationPageQueryVo>, Object> findPageSpecialisation(SpecialisationPageQueryDto dto) {
        return specialisationService.findPageSpecialisation(dto);
    }

    @GetMapping("specialisation")
    @ApiOperation("查询专科管理集合(这里只会返回id和名称)")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "groupId", value = "groupId/查询所有传null", required = false, dataType = "string", paramType = "query"),
    })
    public ResponseResult<List<SpecialisationListVo>, Object> findListSpecialisation(@ApiIgnore TblSpecialisation dto) {
        return specialisationService.findListSpecialisation(dto);
    }
    
}
